package com.qf.springboot2.exhandlers;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public String ex(Exception e){
        e.printStackTrace();

        return "error";
    }

    @ExceptionHandler(BussinessException.class)
    public String bEx(BussinessException bex){

        return "Business Ex";
    }
}
